package com.rentcarRepair.controller.api;

import com.eight.pojo.TbCarCoupon;
import com.eight.vo.ComResult;
import com.rentcarRepair.service.impl.carCouponServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author caoch
 * @since 2023/3/6 10:50
 **/
@RestController
@RequestMapping("rentcar-repair/api")
public class carCouponApiController {
	@Autowired
	private carCouponServiceImpl carCouponService;
	@RequestMapping("addCarCoupon")
	public ComResult addCarCoupon(@RequestBody TbCarCoupon carCoupon) {
		return new ComResult(2000,"success",carCouponService.addCarCoupon(carCoupon));
	}
	@RequestMapping("selectCouponById/{id}")
	public ComResult selectCouponById(@PathVariable int id) {
		return new ComResult(2000,"success",carCouponService.selectCouponById(id));
	}
}
